<template>
  <view class="page10">
    <u-popup
      :show="visible"
      mode="bottom"
      @close="close"
      @touchmove.stop.prevent
    >
      <view class="pop flex-col">
        <view class="top flex">
          <view class="flex1 text-center">选择分类</view>
        </view>
        <scroll-view scroll-y class="list flex1">
          <view
            class="class flex flex-btw"
            v-for="(item, index) in list"
            :key="index"
            @click="chooseShop(item)"
          >
            <view class="name">{{ item.storeName || "全部" }}</view>
            <view class="falg">
              <view v-if="item.id == activeId">1</view>
            </view>
          </view>
        </scroll-view>
      </view>
    </u-popup>
  </view>
</template>
<script>
export default {
  data() {
    return {
      showAdd: false,
      activeId: "",
      list: [],
      showModal: false,
    };
  },
  props: {
    visible: {
      default: false,
    },
    shopList: {
      type: Array,
      default: [],
    },
  },
  watch: {
    shopList(value) {
      this.list = value;
    },
  },
  methods: {
    chooseShop(row) {
      this.activeId = row.shopId;
      this.$emit("chooseShop", row);
      this.close();
    },
    close() {
      this.$emit("update:visible", false);
    },
  },
};
</script>
<style lang='scss' scoped>
.pop {
  height: 66vh;
  padding: 0 20rpx;
  width: calc(100% - 40rpx);
  .top {
    padding: 20rpx 0;
  }
  .list {
    // background: seagreen;
    .class {
      .falg {
        width: 20rpx;
        height: 20rpx;
        border-radius: 50%;
        border: 1px solid;
      }
    }
  }
}
.add-pop {
  position: fixed;
  z-index: 10076;
  background-color: #00000080;
  top: 0;
  left: 0;
  .content {
    background: #fff;
    width: calc(100% - 80rpx);
    padding: 20rpx 30rpx;
    .btns {
    }
  }
}
</style>